<template>
  <div class="title-area flex-row">
    <div class="title">一个简单应用</div>
    <div class="button">
      <i class="el-icon-minus" @click="minimize" ></i>
      <i class="el-icon-full-screen" @click="maximize" ></i>
      <i class="el-icon-close" @click="close" ></i>
    </div>
  </div>
</template>

<script>
import { ipcRenderer } from 'electron'
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  methods: {
    minimize () {
      ipcRenderer.send('win-min')
    },
    maximize () {
      ipcRenderer.send('win-max')
    },
    close () {
      ipcRenderer.send('win-close')
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.title-area{
  -webkit-app-region: drag;
  background: lightcoral;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
  justify-content: space-between;
  .button {
    -webkit-app-region: no-drag;
  }
}
</style>
